const esprima = require('esprima')

var code = 'const answer = 1111'

const token = esprima.tokenize(code)

console.log(token)

const ast = esprima.parse(code)

// console.log(JSON.stringify(ast, null, '  '));

let code1 = 'const func = ()=>{return "abc"}'

const ast1 = esprima.parse(code1)

console.log(JSON.stringify(ast1, null, '  '));